<template>
  <div id="box">
    <van-swipe class="my-swipe" :autoplay="3000" indicator-color="green">
      <van-swipe-item v-for="(v, i) in listarr" :key="i">
        <img :src="v.img" />
      </van-swipe-item>
    </van-swipe>
  </div>
</template>

<script>
// import { swipeata } from "@/api/swipeapi.js";
import axios from "axios";
export default {
  data() {
    return {
      listarr: [],
    };
  },
  mounted() {
    this.swip();
  },
  methods: {
    async swip() {
      let res = await axios({
        url: "/api/xiaomipro/goods/lunbotu1",
        // url: "/api/list",
        method: "get",
      }).then((res)=>{this.listarr = res.data.list})
    },
  },
};
</script>

<style scoped>
#box {
  width: 100%;
  height: 100%;
}
.my-swipe .van-swipe-item {
  color: #fff;
  font-size: 20px;
  text-align: center;
}
img {
  width: 100%;
  height: 100%;
  margin: 0 auto;
}
</style>